import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { MqttServiceProvider } from '../../providers/mqtt-service/mqtt-service';
@Component({
  selector: 'page-contact',
  templateUrl: 'contact.html'
})
export class ContactPage {

  constructor(public navCtrl: NavController,
    private mqttServiceProvider:MqttServiceProvider
  ) {

  }
  mqttSend(data:any)
  { 
     let bytesend= new Uint8Array(12);
     bytesend[0]=0xff;
     bytesend[1]=0xfe;
     bytesend[2]=0x01;   
     bytesend[3]=0xff;
     bytesend[4]=0xfe;
     bytesend[5]=0x01;           
     this.mqttServiceProvider.unsafePublish('/fw/alphair2/123456/down',bytesend);
  }
}
